﻿using log4net;

namespace MaterialTypeRecognition.Shell.Logs
{
    public interface ILog4NetLoggerFactory
    {
        ILog GetLogger(string name);
    }

    public class Log4NetLoggerFactory : ILog4NetLoggerFactory
    {
        public ILog GetLogger(string name)
        {
            return LogManager.GetLogger(name);
        }
    }

    public static class Log4NetExtensions
    {
        public static ILog GetAppLogger(this ILog4NetLoggerFactory factory)
        {
            return factory.GetLogger("AppLogger");
        }

        public static ILog GetMesLogger(this ILog4NetLoggerFactory factory)
        {
            return factory.GetLogger("MesLogger");
        }

        public static ILog GetOperationLogger(this ILog4NetLoggerFactory factory)
        {
            return factory.GetLogger("OperationLogger");
        }
    }
}
